package com.yijiu.response;

import org.json.JSONException;
import org.json.JSONObject;

import com.yijiu.network.Response;
import com.yijiu.resource.InvestRecordDetails;

public class InvestRecordDetailsResponse extends Response {

	public InvestRecordDetails investRecordDetails;

	@Override
	protected void jsonToObject() {
		investRecordDetails = new InvestRecordDetails();
		try {
			JSONObject data = reposonJson.getJSONObject("result");
			investRecordDetails.detailId = data.optLong("detailId");
			investRecordDetails.investFlowCode = data.optString("investFlowCode");
			investRecordDetails.audit = data.optString("audit");
			investRecordDetails.contractNo = data.optString("contractNo");

			investRecordDetails.interestRate = data.optString("interestRate");
			investRecordDetails.extInterest = data.optString("extInterest");
			investRecordDetails.loanNote = data.optString("loanNote");
			investRecordDetails.leastInvestAmount = data.optLong("leastInvestAmount");
			investRecordDetails.amount = data.optString("amount");
			investRecordDetails.divisionAmount = data.optString("divisionAmount");
			investRecordDetails.guaranteeAudit = data.optString("guaranteeAudit");
			investRecordDetails.loanPurpose = data.optString("loanPurpose");
			investRecordDetails.selfDefinedTitle = data.optString("selfDefinedTitle");
			investRecordDetails.deadline = data.optLong("deadline");
			investRecordDetails.guaranteeLicenseNo = data.optString("guaranteeLicenseNo");
			investRecordDetails.profitAmount = data.optString("profitAmount");
			investRecordDetails.investflowCode = data.optString("investflowCode");
			investRecordDetails.effectiveDateTime = data.optString("effectiveDateTime");
			investRecordDetails.tradeStatus = data.optInt("tradeStatus");
			investRecordDetails.timeLimitUnit = data.optString("timeLimitUnit");
			investRecordDetails.tradeName = data.optString("tradeName");
			investRecordDetails.timeLimit = data.optString("timeLimit");
			investRecordDetails.tradeDate = data.optString("tradeDate");
			investRecordDetails.guaranteeName = data.optString("guaranteeName");
			investRecordDetails.expireDateTime = data.optString("expireDateTime");
			investRecordDetails.guaranteeStatement = data.optString("guaranteeStatement");
			investRecordDetails.showExtraProfit = data.optString("showExtraProfit");
			investRecordDetails.userName = data.optString("userName");
			investRecordDetails.urlPIC = data.optString("guaranteeLicenseUrl");
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

}